// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Fitness Version v1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/fit/rest/'>Fitness</a>
 *      <tr><th>API Version<td>v1
 *      <tr><th>API Rev<td>20161128 (697)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/fit/rest/'>
 *              https://developers.google.com/fit/rest/</a>
 *      <tr><th>Discovery Name<td>fitness
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Fitness can be found at
 * <a href='https://developers.google.com/fit/rest/'>https://developers.google.com/fit/rest/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Fitness.v1
{
    /// <summary>The Fitness Service.</summary>
    public class FitnessService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public FitnessService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public FitnessService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            users = new UsersResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "fitness"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/fitness/v1/users/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "fitness/v1/users/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Fitness.</summary>
        public class Scope
        {
            /// <summary>View your activity information in Google Fit</summary>
            public static string FitnessActivityRead = "https://www.googleapis.com/auth/fitness.activity.read";

            /// <summary>View and store your activity information in Google Fit</summary>
            public static string FitnessActivityWrite = "https://www.googleapis.com/auth/fitness.activity.write";

            /// <summary>View blood glucose data in Google Fit</summary>
            public static string FitnessBloodGlucoseRead = "https://www.googleapis.com/auth/fitness.blood_glucose.read";

            /// <summary>View and store blood glucose data in Google Fit</summary>
            public static string FitnessBloodGlucoseWrite = "https://www.googleapis.com/auth/fitness.blood_glucose.write";

            /// <summary>View blood pressure data in Google Fit</summary>
            public static string FitnessBloodPressureRead = "https://www.googleapis.com/auth/fitness.blood_pressure.read";

            /// <summary>View and store blood pressure data in Google Fit</summary>
            public static string FitnessBloodPressureWrite = "https://www.googleapis.com/auth/fitness.blood_pressure.write";

            /// <summary>View body sensor information in Google Fit</summary>
            public static string FitnessBodyRead = "https://www.googleapis.com/auth/fitness.body.read";

            /// <summary>View and store body sensor data in Google Fit</summary>
            public static string FitnessBodyWrite = "https://www.googleapis.com/auth/fitness.body.write";

            /// <summary>View body temperature data in Google Fit</summary>
            public static string FitnessBodyTemperatureRead = "https://www.googleapis.com/auth/fitness.body_temperature.read";

            /// <summary>View and store body temperature data in Google Fit</summary>
            public static string FitnessBodyTemperatureWrite = "https://www.googleapis.com/auth/fitness.body_temperature.write";

            /// <summary>View your stored location data in Google Fit</summary>
            public static string FitnessLocationRead = "https://www.googleapis.com/auth/fitness.location.read";

            /// <summary>View and store your location data in Google Fit</summary>
            public static string FitnessLocationWrite = "https://www.googleapis.com/auth/fitness.location.write";

            /// <summary>View nutrition information in Google Fit</summary>
            public static string FitnessNutritionRead = "https://www.googleapis.com/auth/fitness.nutrition.read";

            /// <summary>View and store nutrition information in Google Fit</summary>
            public static string FitnessNutritionWrite = "https://www.googleapis.com/auth/fitness.nutrition.write";

            /// <summary>View oxygen saturation data in Google Fit</summary>
            public static string FitnessOxygenSaturationRead = "https://www.googleapis.com/auth/fitness.oxygen_saturation.read";

            /// <summary>View and store oxygen saturation data in Google Fit</summary>
            public static string FitnessOxygenSaturationWrite = "https://www.googleapis.com/auth/fitness.oxygen_saturation.write";

            /// <summary>View reproductive health data in Google Fit</summary>
            public static string FitnessReproductiveHealthRead = "https://www.googleapis.com/auth/fitness.reproductive_health.read";

            /// <summary>View and store reproductive health data in Google Fit</summary>
            public static string FitnessReproductiveHealthWrite = "https://www.googleapis.com/auth/fitness.reproductive_health.write";

        }



        private readonly UsersResource users;

        /// <summary>Gets the Users resource.</summary>
        public virtual UsersResource Users
        {
            get { return users; }
        }
    }

    ///<summary>A base abstract class for Fitness requests.</summary>
    public abstract class FitnessBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new FitnessBaseServiceRequest instance.</summary>
        protected FitnessBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes Fitness parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "users" collection of methods.</summary>
    public class UsersResource
    {
        private const string Resource = "users";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public UsersResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            dataSources = new DataSourcesResource(service);
            dataset = new DatasetResource(service);
            sessions = new SessionsResource(service);

        }

        private readonly DataSourcesResource dataSources;

        /// <summary>Gets the DataSources resource.</summary>
        public virtual DataSourcesResource DataSources
        {
            get { return dataSources; }
        }

        /// <summary>The "dataSources" collection of methods.</summary>
        public class DataSourcesResource
        {
            private const string Resource = "dataSources";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public DataSourcesResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;
                datasets = new DatasetsResource(service);

            }

            private readonly DatasetsResource datasets;

            /// <summary>Gets the Datasets resource.</summary>
            public virtual DatasetsResource Datasets
            {
                get { return datasets; }
            }

            /// <summary>The "datasets" collection of methods.</summary>
            public class DatasetsResource
            {
                private const string Resource = "datasets";

                /// <summary>The service which this resource belongs to.</summary>
                private readonly Google.Apis.Services.IClientService service;

                /// <summary>Constructs a new resource.</summary>
                public DatasetsResource(Google.Apis.Services.IClientService service)
                {
                    this.service = service;

                }


                /// <summary>Performs an inclusive delete of all data points whose start and end times have any overlap
                /// with the time range specified by the dataset ID. For most data types, the entire data point will be
                /// deleted. For data types where the time span represents a consistent value (such as
                /// com.google.activity.segment), and a data point straddles either end point of the dataset, only the
                /// overlapping portion of the data point will be deleted.</summary>
                /// <param name="userId">Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me
                /// is supported at this time.</param>
                /// <param name="dataSourceId">The data stream ID of the data source that
                /// created the dataset.</param>
                /// <param name="datasetId">Dataset identifier that is a composite of the minimum
                /// data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted
                /// like: "startTime-endTime" where startTime and endTime are 64 bit integers.</param>
                public virtual DeleteRequest Delete(string userId, string dataSourceId, string datasetId)
                {
                    return new DeleteRequest(service, userId, dataSourceId, datasetId);
                }

                /// <summary>Performs an inclusive delete of all data points whose start and end times have any overlap
                /// with the time range specified by the dataset ID. For most data types, the entire data point will be
                /// deleted. For data types where the time span represents a consistent value (such as
                /// com.google.activity.segment), and a data point straddles either end point of the dataset, only the
                /// overlapping portion of the data point will be deleted.</summary>
                public class DeleteRequest : FitnessBaseServiceRequest<string>
                {
                    /// <summary>Constructs a new Delete request.</summary>
                    public DeleteRequest(Google.Apis.Services.IClientService service, string userId, string dataSourceId, string datasetId)
                        : base(service)
                    {
                        UserId = userId;
                        DataSourceId = dataSourceId;
                        DatasetId = datasetId;
                        InitParameters();
                    }


                    /// <summary>Delete a dataset for the person identified. Use me to indicate the authenticated user.
                    /// Only me is supported at this time.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string UserId { get; private set; }

                    /// <summary>The data stream ID of the data source that created the dataset.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DataSourceId { get; private set; }

                    /// <summary>Dataset identifier that is a composite of the minimum data point start time and maximum
                    /// data point end time represented as nanoseconds from the epoch. The ID is formatted like:
                    /// "startTime-endTime" where startTime and endTime are 64 bit integers.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DatasetId { get; private set; }

                    /// <summary>The client's current time in milliseconds since epoch.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("currentTimeMillis", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<long> CurrentTimeMillis { get; set; }

                    /// <summary>When the operation was performed on the client.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("modifiedTimeMillis", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<long> ModifiedTimeMillis { get; set; }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "delete"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "DELETE"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}"; }
                    }

                    /// <summary>Initializes Delete parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "userId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "userId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "dataSourceId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "dataSourceId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "datasetId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "datasetId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "currentTimeMillis", new Google.Apis.Discovery.Parameter
                            {
                                Name = "currentTimeMillis",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "modifiedTimeMillis", new Google.Apis.Discovery.Parameter
                            {
                                Name = "modifiedTimeMillis",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }

                /// <summary>Returns a dataset containing all data points whose start and end times overlap with the
                /// specified range of the dataset minimum start time and maximum end time. Specifically, any data point
                /// whose start time is less than or equal to the dataset end time and whose end time is greater than or
                /// equal to the dataset start time.</summary>
                /// <param name="userId">Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only
                /// me is supported at this time.</param>
                /// <param name="dataSourceId">The data stream ID of the data source that
                /// created the dataset.</param>
                /// <param name="datasetId">Dataset identifier that is a composite of the minimum
                /// data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted
                /// like: "startTime-endTime" where startTime and endTime are 64 bit integers.</param>
                public virtual GetRequest Get(string userId, string dataSourceId, string datasetId)
                {
                    return new GetRequest(service, userId, dataSourceId, datasetId);
                }

                /// <summary>Returns a dataset containing all data points whose start and end times overlap with the
                /// specified range of the dataset minimum start time and maximum end time. Specifically, any data point
                /// whose start time is less than or equal to the dataset end time and whose end time is greater than or
                /// equal to the dataset start time.</summary>
                public class GetRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.Dataset>
                {
                    /// <summary>Constructs a new Get request.</summary>
                    public GetRequest(Google.Apis.Services.IClientService service, string userId, string dataSourceId, string datasetId)
                        : base(service)
                    {
                        UserId = userId;
                        DataSourceId = dataSourceId;
                        DatasetId = datasetId;
                        InitParameters();
                    }


                    /// <summary>Retrieve a dataset for the person identified. Use me to indicate the authenticated
                    /// user. Only me is supported at this time.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string UserId { get; private set; }

                    /// <summary>The data stream ID of the data source that created the dataset.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DataSourceId { get; private set; }

                    /// <summary>Dataset identifier that is a composite of the minimum data point start time and maximum
                    /// data point end time represented as nanoseconds from the epoch. The ID is formatted like:
                    /// "startTime-endTime" where startTime and endTime are 64 bit integers.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DatasetId { get; private set; }

                    /// <summary>If specified, no more than this many data points will be included in the dataset. If
                    /// there are more data points in the dataset, nextPageToken will be set in the dataset
                    /// response.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("limit", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<int> Limit { get; set; }

                    /// <summary>The continuation token, which is used to page through large datasets. To get the next
                    /// page of a dataset, set this parameter to the value of nextPageToken from the previous response.
                    /// Each subsequent call will yield a partial dataset with data point end timestamps that are
                    /// strictly smaller than those in the previous partial response.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual string PageToken { get; set; }


                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "get"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "GET"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}"; }
                    }

                    /// <summary>Initializes Get parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "userId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "userId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "dataSourceId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "dataSourceId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "datasetId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "datasetId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "limit", new Google.Apis.Discovery.Parameter
                            {
                                Name = "limit",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "pageToken", new Google.Apis.Discovery.Parameter
                            {
                                Name = "pageToken",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }

                /// <summary>Adds data points to a dataset. The dataset need not be previously created. All points
                /// within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points
                /// can belong to more than one dataset. This method does not use patch semantics.</summary>
                /// <param name="body">The body of the request.</param>
                /// <param name="userId">Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me
                /// is supported at this time.</param>
                /// <param name="dataSourceId">The data stream ID of the data source that
                /// created the dataset.</param>
                /// <param name="datasetId">Dataset identifier that is a composite of the minimum
                /// data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted
                /// like: "startTime-endTime" where startTime and endTime are 64 bit integers.</param>
                public virtual PatchRequest Patch(Google.Apis.Fitness.v1.Data.Dataset body, string userId, string dataSourceId, string datasetId)
                {
                    return new PatchRequest(service, body, userId, dataSourceId, datasetId);
                }

                /// <summary>Adds data points to a dataset. The dataset need not be previously created. All points
                /// within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points
                /// can belong to more than one dataset. This method does not use patch semantics.</summary>
                public class PatchRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.Dataset>
                {
                    /// <summary>Constructs a new Patch request.</summary>
                    public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.Dataset body, string userId, string dataSourceId, string datasetId)
                        : base(service)
                    {
                        UserId = userId;
                        DataSourceId = dataSourceId;
                        DatasetId = datasetId;
                        Body = body;
                        InitParameters();
                    }


                    /// <summary>Patch a dataset for the person identified. Use me to indicate the authenticated user.
                    /// Only me is supported at this time.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string UserId { get; private set; }

                    /// <summary>The data stream ID of the data source that created the dataset.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DataSourceId { get; private set; }

                    /// <summary>Dataset identifier that is a composite of the minimum data point start time and maximum
                    /// data point end time represented as nanoseconds from the epoch. The ID is formatted like:
                    /// "startTime-endTime" where startTime and endTime are 64 bit integers.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
                    public virtual string DatasetId { get; private set; }

                    /// <summary>The client's current time in milliseconds since epoch. Note that the minStartTimeNs and
                    /// maxEndTimeNs properties in the request body are in nanoseconds instead of
                    /// milliseconds.</summary>
                    [Google.Apis.Util.RequestParameterAttribute("currentTimeMillis", Google.Apis.Util.RequestParameterType.Query)]
                    public virtual System.Nullable<long> CurrentTimeMillis { get; set; }


                    /// <summary>Gets or sets the body of this request.</summary>
                    Google.Apis.Fitness.v1.Data.Dataset Body { get; set; }

                    ///<summary>Returns the body of the request.</summary>
                    protected override object GetBody() { return Body; }

                    ///<summary>Gets the method name.</summary>
                    public override string MethodName
                    {
                        get { return "patch"; }
                    }

                    ///<summary>Gets the HTTP method.</summary>
                    public override string HttpMethod
                    {
                        get { return "PATCH"; }
                    }

                    ///<summary>Gets the REST path.</summary>
                    public override string RestPath
                    {
                        get { return "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}"; }
                    }

                    /// <summary>Initializes Patch parameter list.</summary>
                    protected override void InitParameters()
                    {
                        base.InitParameters();

                        RequestParameters.Add(
                            "userId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "userId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "dataSourceId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "dataSourceId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "datasetId", new Google.Apis.Discovery.Parameter
                            {
                                Name = "datasetId",
                                IsRequired = true,
                                ParameterType = "path",
                                DefaultValue = null,
                                Pattern = null,
                            });
                        RequestParameters.Add(
                            "currentTimeMillis", new Google.Apis.Discovery.Parameter
                            {
                                Name = "currentTimeMillis",
                                IsRequired = false,
                                ParameterType = "query",
                                DefaultValue = null,
                                Pattern = null,
                            });
                    }

                }
            }

            /// <summary>Creates a new data source that is unique across all data sources belonging to this user. The
            /// data stream ID field can be omitted and will be generated by the server with the correct format. The
            /// data stream ID is an ordered combination of some fields from the data source. In addition to the data
            /// source fields reflected into the data source ID, the developer project number that is authenticated when
            /// creating the data source is included. This developer project number is obfuscated when read by any other
            /// developer reading public data types.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="userId">Create the data source for the person identified. Use me to indicate the authenticated user.
            /// Only me is supported at this time.</param>
            public virtual CreateRequest Create(Google.Apis.Fitness.v1.Data.DataSource body, string userId)
            {
                return new CreateRequest(service, body, userId);
            }

            /// <summary>Creates a new data source that is unique across all data sources belonging to this user. The
            /// data stream ID field can be omitted and will be generated by the server with the correct format. The
            /// data stream ID is an ordered combination of some fields from the data source. In addition to the data
            /// source fields reflected into the data source ID, the developer project number that is authenticated when
            /// creating the data source is included. This developer project number is obfuscated when read by any other
            /// developer reading public data types.</summary>
            public class CreateRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.DataSource>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.DataSource body, string userId)
                    : base(service)
                {
                    UserId = userId;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Create the data source for the person identified. Use me to indicate the authenticated
                /// user. Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Fitness.v1.Data.DataSource Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Deletes the specified data source. The request will fail if the data source contains any data
            /// points.</summary>
            /// <param name="userId">Retrieve a data source for the person identified. Use me to indicate the authenticated user.
            /// Only me is supported at this time.</param>
            /// <param name="dataSourceId">The data stream ID of the data source
            /// to delete.</param>
            public virtual DeleteRequest Delete(string userId, string dataSourceId)
            {
                return new DeleteRequest(service, userId, dataSourceId);
            }

            /// <summary>Deletes the specified data source. The request will fail if the data source contains any data
            /// points.</summary>
            public class DeleteRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.DataSource>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string userId, string dataSourceId)
                    : base(service)
                {
                    UserId = userId;
                    DataSourceId = dataSourceId;
                    InitParameters();
                }


                /// <summary>Retrieve a data source for the person identified. Use me to indicate the authenticated
                /// user. Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The data stream ID of the data source to delete.</summary>
                [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string DataSourceId { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources/{dataSourceId}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "dataSourceId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "dataSourceId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Returns the specified data source.</summary>
            /// <param name="userId">Retrieve a data source for the person identified. Use me to indicate the authenticated user.
            /// Only me is supported at this time.</param>
            /// <param name="dataSourceId">The data stream ID of the data source
            /// to retrieve.</param>
            public virtual GetRequest Get(string userId, string dataSourceId)
            {
                return new GetRequest(service, userId, dataSourceId);
            }

            /// <summary>Returns the specified data source.</summary>
            public class GetRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.DataSource>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string userId, string dataSourceId)
                    : base(service)
                {
                    UserId = userId;
                    DataSourceId = dataSourceId;
                    InitParameters();
                }


                /// <summary>Retrieve a data source for the person identified. Use me to indicate the authenticated
                /// user. Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The data stream ID of the data source to retrieve.</summary>
                [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string DataSourceId { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources/{dataSourceId}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "dataSourceId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "dataSourceId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Lists all data sources that are visible to the developer, using the OAuth scopes provided. The
            /// list is not exhaustive; the user may have private data sources that are only visible to other
            /// developers, or calls using other scopes.</summary>
            /// <param name="userId">List data sources for the person identified. Use me to indicate the authenticated user. Only me
            /// is supported at this time.</param>
            public virtual ListRequest List(string userId)
            {
                return new ListRequest(service, userId);
            }

            /// <summary>Lists all data sources that are visible to the developer, using the OAuth scopes provided. The
            /// list is not exhaustive; the user may have private data sources that are only visible to other
            /// developers, or calls using other scopes.</summary>
            public class ListRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.ListDataSourcesResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string userId)
                    : base(service)
                {
                    UserId = userId;
                    InitParameters();
                }


                /// <summary>List data sources for the person identified. Use me to indicate the authenticated user.
                /// Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The names of data types to include in the list. If not specified, all data sources will be
                /// returned.</summary>
                [Google.Apis.Util.RequestParameterAttribute("dataTypeName", Google.Apis.Util.RequestParameterType.Query)]
                public virtual Google.Apis.Util.Repeatable<string> DataTypeName { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "dataTypeName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "dataTypeName",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device
            /// properties with the exception of version, cannot be modified.
            ///
            /// Data sources are identified by their dataStreamId. This method supports patch semantics.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="userId">Update the data source for the person identified. Use me to indicate the authenticated user.
            /// Only me is supported at this time.</param>
            /// <param name="dataSourceId">The data stream ID of the data source
            /// to update.</param>
            public virtual PatchRequest Patch(Google.Apis.Fitness.v1.Data.DataSource body, string userId, string dataSourceId)
            {
                return new PatchRequest(service, body, userId, dataSourceId);
            }

            /// <summary>Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device
            /// properties with the exception of version, cannot be modified.
            ///
            /// Data sources are identified by their dataStreamId. This method supports patch semantics.</summary>
            public class PatchRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.DataSource>
            {
                /// <summary>Constructs a new Patch request.</summary>
                public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.DataSource body, string userId, string dataSourceId)
                    : base(service)
                {
                    UserId = userId;
                    DataSourceId = dataSourceId;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Update the data source for the person identified. Use me to indicate the authenticated
                /// user. Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The data stream ID of the data source to update.</summary>
                [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string DataSourceId { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Fitness.v1.Data.DataSource Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "patch"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PATCH"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources/{dataSourceId}"; }
                }

                /// <summary>Initializes Patch parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "dataSourceId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "dataSourceId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device
            /// properties with the exception of version, cannot be modified.
            ///
            /// Data sources are identified by their dataStreamId.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="userId">Update the data source for the person identified. Use me to indicate the authenticated user.
            /// Only me is supported at this time.</param>
            /// <param name="dataSourceId">The data stream ID of the data source
            /// to update.</param>
            public virtual UpdateRequest Update(Google.Apis.Fitness.v1.Data.DataSource body, string userId, string dataSourceId)
            {
                return new UpdateRequest(service, body, userId, dataSourceId);
            }

            /// <summary>Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device
            /// properties with the exception of version, cannot be modified.
            ///
            /// Data sources are identified by their dataStreamId.</summary>
            public class UpdateRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.DataSource>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.DataSource body, string userId, string dataSourceId)
                    : base(service)
                {
                    UserId = userId;
                    DataSourceId = dataSourceId;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Update the data source for the person identified. Use me to indicate the authenticated
                /// user. Only me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The data stream ID of the data source to update.</summary>
                [Google.Apis.Util.RequestParameterAttribute("dataSourceId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string DataSourceId { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Fitness.v1.Data.DataSource Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataSources/{dataSourceId}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "dataSourceId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "dataSourceId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly DatasetResource dataset;

        /// <summary>Gets the Dataset resource.</summary>
        public virtual DatasetResource Dataset
        {
            get { return dataset; }
        }

        /// <summary>The "dataset" collection of methods.</summary>
        public class DatasetResource
        {
            private const string Resource = "dataset";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public DatasetResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Aggregates data of a certain type or stream into buckets divided by a given type of boundary.
            /// Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket
            /// type per request.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="userId">Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is
            /// supported at this time.</param>
            public virtual AggregateRequest Aggregate(Google.Apis.Fitness.v1.Data.AggregateRequest body, string userId)
            {
                return new AggregateRequest(service, body, userId);
            }

            /// <summary>Aggregates data of a certain type or stream into buckets divided by a given type of boundary.
            /// Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket
            /// type per request.</summary>
            public class AggregateRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.AggregateResponse>
            {
                /// <summary>Constructs a new Aggregate request.</summary>
                public AggregateRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.AggregateRequest body, string userId)
                    : base(service)
                {
                    UserId = userId;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Aggregate data for the person identified. Use me to indicate the authenticated user. Only
                /// me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Fitness.v1.Data.AggregateRequest Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "aggregate"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/dataset:aggregate"; }
                }

                /// <summary>Initializes Aggregate parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly SessionsResource sessions;

        /// <summary>Gets the Sessions resource.</summary>
        public virtual SessionsResource Sessions
        {
            get { return sessions; }
        }

        /// <summary>The "sessions" collection of methods.</summary>
        public class SessionsResource
        {
            private const string Resource = "sessions";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SessionsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Deletes a session specified by the given session ID.</summary>
            /// <param name="userId">Delete a session for the person identified. Use me to indicate the authenticated user. Only me
            /// is supported at this time.</param>
            /// <param name="sessionId">The ID of the session to be deleted.</param>
            public virtual DeleteRequest Delete(string userId, string sessionId)
            {
                return new DeleteRequest(service, userId, sessionId);
            }

            /// <summary>Deletes a session specified by the given session ID.</summary>
            public class DeleteRequest : FitnessBaseServiceRequest<string>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string userId, string sessionId)
                    : base(service)
                {
                    UserId = userId;
                    SessionId = sessionId;
                    InitParameters();
                }


                /// <summary>Delete a session for the person identified. Use me to indicate the authenticated user. Only
                /// me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The ID of the session to be deleted.</summary>
                [Google.Apis.Util.RequestParameterAttribute("sessionId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SessionId { get; private set; }

                /// <summary>The client's current time in milliseconds since epoch.</summary>
                [Google.Apis.Util.RequestParameterAttribute("currentTimeMillis", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<long> CurrentTimeMillis { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/sessions/{sessionId}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "sessionId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sessionId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "currentTimeMillis", new Google.Apis.Discovery.Parameter
                        {
                            Name = "currentTimeMillis",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Lists sessions previously created.</summary>
            /// <param name="userId">List sessions for the person identified. Use me to indicate the authenticated user. Only me is
            /// supported at this time.</param>
            public virtual ListRequest List(string userId)
            {
                return new ListRequest(service, userId);
            }

            /// <summary>Lists sessions previously created.</summary>
            public class ListRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.ListSessionsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string userId)
                    : base(service)
                {
                    UserId = userId;
                    InitParameters();
                }


                /// <summary>List sessions for the person identified. Use me to indicate the authenticated user. Only me
                /// is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>An RFC3339 timestamp. Only sessions ending between the start and end times will be included
                /// in the response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("endTime", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string EndTime { get; set; }

                /// <summary>If true, deleted sessions will be returned. When set to true, sessions returned in this
                /// response will only have an ID and will not have any other fields.</summary>
                [Google.Apis.Util.RequestParameterAttribute("includeDeleted", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> IncludeDeleted { get; set; }

                /// <summary>The continuation token, which is used to page through large result sets. To get the next
                /// page of results, set this parameter to the value of nextPageToken from the previous
                /// response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>An RFC3339 timestamp. Only sessions ending between the start and end times will be included
                /// in the response.</summary>
                [Google.Apis.Util.RequestParameterAttribute("startTime", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string StartTime { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/sessions"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "endTime", new Google.Apis.Discovery.Parameter
                        {
                            Name = "endTime",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "includeDeleted", new Google.Apis.Discovery.Parameter
                        {
                            Name = "includeDeleted",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "startTime", new Google.Apis.Discovery.Parameter
                        {
                            Name = "startTime",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates or insert a given session.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="userId">Create sessions for the person identified. Use me to indicate the authenticated user. Only me
            /// is supported at this time.</param>
            /// <param name="sessionId">The ID of the session to be created.</param>
            public virtual UpdateRequest Update(Google.Apis.Fitness.v1.Data.Session body, string userId, string sessionId)
            {
                return new UpdateRequest(service, body, userId, sessionId);
            }

            /// <summary>Updates or insert a given session.</summary>
            public class UpdateRequest : FitnessBaseServiceRequest<Google.Apis.Fitness.v1.Data.Session>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Fitness.v1.Data.Session body, string userId, string sessionId)
                    : base(service)
                {
                    UserId = userId;
                    SessionId = sessionId;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Create sessions for the person identified. Use me to indicate the authenticated user. Only
                /// me is supported at this time.</summary>
                [Google.Apis.Util.RequestParameterAttribute("userId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string UserId { get; private set; }

                /// <summary>The ID of the session to be created.</summary>
                [Google.Apis.Util.RequestParameterAttribute("sessionId", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SessionId { get; private set; }

                /// <summary>The client's current time in milliseconds since epoch.</summary>
                [Google.Apis.Util.RequestParameterAttribute("currentTimeMillis", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<long> CurrentTimeMillis { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Fitness.v1.Data.Session Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "{userId}/sessions/{sessionId}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "userId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "userId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "sessionId", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sessionId",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "currentTimeMillis", new Google.Apis.Discovery.Parameter
                        {
                            Name = "currentTimeMillis",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }
}

namespace Google.Apis.Fitness.v1.Data
{    

    public class AggregateBucket : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("activity")]
        public virtual System.Nullable<int> Activity { get; set; } 

        /// <summary>There will be one dataset per AggregateBy in the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataset")]
        public virtual System.Collections.Generic.IList<Dataset> Dataset { get; set; } 

        /// <summary>The end time for the aggregated data, in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTimeMillis")]
        public virtual System.Nullable<long> EndTimeMillis { get; set; } 

        /// <summary>Available for Bucket.Type.SESSION</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("session")]
        public virtual Session Session { get; set; } 

        /// <summary>The start time for the aggregated data, in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTimeMillis")]
        public virtual System.Nullable<long> StartTimeMillis { get; set; } 

        /// <summary>The type of a bucket signifies how the data aggregation is performed in the bucket.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The specification of which data to aggregate.</summary>
    public class AggregateBy : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified
        /// data source ID will be included in the aggregation. The dataset in the response will have the same data
        /// source ID.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataSourceId")]
        public virtual string DataSourceId { get; set; } 

        /// <summary>The data type to aggregate. All data sources providing this data type will contribute data to the
        /// aggregation. The response will contain a single dataset for this data type name. The dataset will have a
        /// data source ID of derived:com.google.:com.google.android.gms:aggregated</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataTypeName")]
        public virtual string DataTypeName { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Next id: 10</summary>
    public class AggregateRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The specification of data to be aggregated. At least one aggregateBy spec must be provided. All
        /// data that is specified will be aggregated using the same bucketing criteria. There will be one dataset in
        /// the response for every aggregateBy spec.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("aggregateBy")]
        public virtual System.Collections.Generic.IList<AggregateBy> AggregateBy { get; set; } 

        /// <summary>Specifies that data be aggregated each activity segment recored for a user. Similar to
        /// bucketByActivitySegment, but bucketing is done for each activity segment rather than all segments of the
        /// same type. Mutually exclusive of other bucketing specifications.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bucketByActivitySegment")]
        public virtual BucketByActivity BucketByActivitySegment { get; set; } 

        /// <summary>Specifies that data be aggregated by the type of activity being performed when the data was
        /// recorded. All data that was recorded during a certain activity type (for the given time range) will be
        /// aggregated into the same bucket. Data that was recorded while the user was not active will not be included
        /// in the response. Mutually exclusive of other bucketing specifications.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bucketByActivityType")]
        public virtual BucketByActivity BucketByActivityType { get; set; } 

        /// <summary>Specifies that data be aggregated by user sessions. Data that does not fall within the time range
        /// of a session will not be included in the response. Mutually exclusive of other bucketing
        /// specifications.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bucketBySession")]
        public virtual BucketBySession BucketBySession { get; set; } 

        /// <summary>Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing
        /// specifications.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bucketByTime")]
        public virtual BucketByTime BucketByTime { get; set; } 

        /// <summary>The end of a window of time. Data that intersects with this time window will be aggregated. The
        /// time is in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTimeMillis")]
        public virtual System.Nullable<long> EndTimeMillis { get; set; } 

        /// <summary>A list of acceptable data quality standards. Only data points which conform to at least one of the
        /// specified data quality standards will be returned. If the list is empty, all data points are
        /// returned.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filteredDataQualityStandard")]
        public virtual System.Collections.Generic.IList<string> FilteredDataQualityStandard { get; set; } 

        /// <summary>The start of a window of time. Data that intersects with this time window will be aggregated. The
        /// time is in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTimeMillis")]
        public virtual System.Nullable<long> StartTimeMillis { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class AggregateResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of buckets containing the aggregated data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("bucket")]
        public virtual System.Collections.Generic.IList<AggregateBucket> Bucket { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class Application : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>An optional URI that can be used to link back to the application.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("detailsUrl")]
        public virtual string DetailsUrl { get; set; } 

        /// <summary>The name of this application. This is required for REST clients, but we do not enforce uniqueness
        /// of this name. It is provided as a matter of convenience for other developers who would like to identify
        /// which REST created an Application or Data Source.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>Package name for this application. This is used as a unique identifier when created by Android
        /// applications, but cannot be specified by REST clients. REST clients will have their developer project number
        /// reflected into the Data Source data stream IDs, instead of the packageName.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("packageName")]
        public virtual string PackageName { get; set; } 

        /// <summary>Version of the application. You should update this field whenever the application changes in a way
        /// that affects the computation of the data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("version")]
        public virtual string Version { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BucketByActivity : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The default activity stream will be used if a specific activityDataSourceId is not
        /// specified.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("activityDataSourceId")]
        public virtual string ActivityDataSourceId { get; set; } 

        /// <summary>Specifies that only activity segments of duration longer than minDurationMillis are considered and
        /// used as a container for aggregated data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("minDurationMillis")]
        public virtual System.Nullable<long> MinDurationMillis { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BucketBySession : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Specifies that only sessions of duration longer than minDurationMillis are considered and used as a
        /// container for aggregated data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("minDurationMillis")]
        public virtual System.Nullable<long> MinDurationMillis { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BucketByTime : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames
        /// that contain no data will be included in the response with an empty dataset.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("durationMillis")]
        public virtual System.Nullable<long> DurationMillis { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("period")]
        public virtual BucketByTimePeriod Period { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BucketByTimePeriod : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>org.joda.timezone.DateTimeZone</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timeZoneId")]
        public virtual string TimeZoneId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual System.Nullable<int> Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Represents a single data point, generated by a particular data source. A data point holds a value for
    /// each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are
    /// specified in the documentation for the particular data type.
    ///
    /// A data point can represent an instantaneous measurement, reading or input observation, as well as averages or
    /// aggregates over a time interval. Check the data type documentation to determine which is the case for a
    /// particular data type.
    ///
    /// Data points always contain one value for each field of the data type.</summary>
    public class DataPoint : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Used for version checking during transformation; that is, a datapoint can only replace another
        /// datapoint that has an older computation time stamp.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("computationTimeMillis")]
        public virtual System.Nullable<long> ComputationTimeMillis { get; set; } 

        /// <summary>The data type defining the format of the values in this data point.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataTypeName")]
        public virtual string DataTypeName { get; set; } 

        /// <summary>The end time of the interval represented by this data point, in nanoseconds since epoch.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTimeNanos")]
        public virtual System.Nullable<long> EndTimeNanos { get; set; } 

        /// <summary>Indicates the last time this data point was modified. Useful only in contexts where we are listing
        /// the data changes, rather than representing the current state of the data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modifiedTimeMillis")]
        public virtual System.Nullable<long> ModifiedTimeMillis { get; set; } 

        /// <summary>If the data point is contained in a dataset for a derived data source, this field will be populated
        /// with the data source stream ID that created the data point originally.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("originDataSourceId")]
        public virtual string OriginDataSourceId { get; set; } 

        /// <summary>The raw timestamp from the original SensorEvent.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("rawTimestampNanos")]
        public virtual System.Nullable<long> RawTimestampNanos { get; set; } 

        /// <summary>The start time of the interval represented by this data point, in nanoseconds since
        /// epoch.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTimeNanos")]
        public virtual System.Nullable<long> StartTimeNanos { get; set; } 

        /// <summary>Values of each data type field for the data point. It is expected that each value corresponding to
        /// a data type field will occur in the same order that the field is listed with in the data type specified in a
        /// data source.
        ///
        /// Only one of integer and floating point fields will be populated, depending on the format enum value within
        /// data source's type field.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual System.Collections.Generic.IList<Value> Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Definition of a unique source of sensor data. Data sources can expose raw data coming from hardware
    /// sensors on local or companion devices. They can also expose derived data, created by transforming or merging
    /// other data sources. Multiple data sources can exist for the same data type. Every data point inserted into or
    /// read from this service has an associated data source.
    ///
    /// The data source contains enough information to uniquely identify its data, including the hardware device and the
    /// application that collected and/or transformed the data. It also holds useful metadata, such as the hardware and
    /// application versions, and the device type.
    ///
    /// Each data source produces a unique stream of data, with a unique identifier. Not all changes to data source
    /// affect the stream identifier, so that data collected by updated versions of the same application/device can
    /// still be considered to belong to the same data stream.</summary>
    public class DataSource : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Information about an application which feeds sensor data into the platform.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("application")]
        public virtual Application Application { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("dataQualityStandard")]
        public virtual System.Collections.Generic.IList<string> DataQualityStandard { get; set; } 

        /// <summary>A unique identifier for the data stream produced by this data source. The identifier includes:
        ///
        /// - The physical device's manufacturer, model, and serial number (UID). - The application's package name or
        /// name. Package name is used when the data source was created by an Android application. The developer project
        /// number is used when the data source was created by a REST client. - The data source's type. - The data
        /// source's stream name.  Note that not all attributes of the data source are used as part of the stream
        /// identifier. In particular, the version of the hardware/the application isn't used. This allows us to
        /// preserve the same stream through version updates. This also means that two DataSource objects may represent
        /// the same data stream even if they're not equal.
        ///
        /// The exact format of the data stream ID created by an Android application is:
        /// type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName
        ///
        /// The exact format of the data stream ID created by a REST client is: type:dataType.name:developer project
        /// number:device.manufacturer:device.model:device.uid:dataStreamName
        ///
        /// When any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the
        /// data stream ID. The minnimum viable data stream ID would be: type:dataType.name:developer project number
        ///
        /// Finally, the developer project number is obfuscated when read by any REST or Android client that did not
        /// create the data source. Only the data source creator will see the developer project number in clear and
        /// normal form.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataStreamId")]
        public virtual string DataStreamId { get; set; } 

        /// <summary>The stream name uniquely identifies this particular data source among other data sources of the
        /// same type from the same underlying producer. Setting the stream name is optional, but should be done
        /// whenever an application exposes two streams for the same data type, or when a device has two equivalent
        /// sensors.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataStreamName")]
        public virtual string DataStreamName { get; set; } 

        /// <summary>The data type defines the schema for a stream of data being collected by, inserted into, or queried
        /// from the Fitness API.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataType")]
        public virtual DataType DataType { get; set; } 

        /// <summary>Representation of an integrated device (such as a phone or a wearable) that can hold
        /// sensors.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("device")]
        public virtual Device Device { get; set; } 

        /// <summary>An end-user visible name for this data source.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>A constant describing the type of this data source. Indicates whether this data source produces raw
        /// or derived data.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class DataType : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A field represents one dimension of a data type.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("field")]
        public virtual System.Collections.Generic.IList<DataTypeField> Field { get; set; } 

        /// <summary>Each data type has a unique, namespaced, name. All data types in the com.google namespace are
        /// shared as part of the platform.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field
    /// represents one dimension. Each data type field has a unique name which identifies it. The field also defines the
    /// format of the data (int, float, etc.).
    ///
    /// This message is only instantiated in code and not used for wire comms or stored in any way.</summary>
    public class DataTypeField : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The different supported formats for each field in a data type.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("format")]
        public virtual string Format { get; set; } 

        /// <summary>Defines the name and format of data. Unlike data type names, field names are not namespaced, and
        /// only need to be unique within the data type.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("optional")]
        public virtual System.Nullable<bool> Optional { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A dataset represents a projection container for data points. They do not carry any info of their own.
    /// Datasets represent a set of data points from a particular data source. A data point can be found in more than
    /// one dataset.</summary>
    public class Dataset : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The data stream ID of the data source that created the points in this dataset.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataSourceId")]
        public virtual string DataSourceId { get; set; } 

        /// <summary>The largest end time of all data points in this possibly partial representation of the dataset.
        /// Time is in nanoseconds from epoch. This should also match the first part of the dataset
        /// identifier.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("maxEndTimeNs")]
        public virtual System.Nullable<long> MaxEndTimeNs { get; set; } 

        /// <summary>The smallest start time of all data points in this possibly partial representation of the dataset.
        /// Time is in nanoseconds from epoch. This should also match the first part of the dataset
        /// identifier.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("minStartTimeNs")]
        public virtual System.Nullable<long> MinStartTimeNs { get; set; } 

        /// <summary>This token will be set when a dataset is received in response to a GET request and the dataset is
        /// too large to be included in a single response. Provide this value in a subsequent GET request to return the
        /// next page of data points within this dataset.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>A partial list of data points contained in the dataset, ordered by largest endTimeNanos first. This
        /// list is considered complete when retrieving a small dataset and partial when patching a dataset or
        /// retrieving a dataset that is too large to include in a single response.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("point")]
        public virtual System.Collections.Generic.IList<DataPoint> Point { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each
    /// sensor is exposed as a data source.
    ///
    /// The main purpose of the device information contained in this class is to identify the hardware of a particular
    /// data source. This can be useful in different ways, including: - Distinguishing two similar sensors on different
    /// devices (the step counter on two nexus 5 phones, for instance) - Display the source of data to the user (by
    /// using the device make / model) - Treat data differently depending on sensor type (accelerometers on a watch may
    /// give different patterns than those on a phone) - Build different analysis models for each
    /// device/version.</summary>
    public class Device : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Manufacturer of the product/hardware.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("manufacturer")]
        public virtual string Manufacturer { get; set; } 

        /// <summary>End-user visible model name for the device.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("model")]
        public virtual string Model { get; set; } 

        /// <summary>A constant representing the type of the device.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The serial number or other unique ID for the hardware. This field is obfuscated when read by any
        /// REST or Android client that did not create the data source. Only the data source creator will see the uid
        /// field in clear and normal form.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("uid")]
        public virtual string Uid { get; set; } 

        /// <summary>Version string for the device hardware/software.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("version")]
        public virtual string Version { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ListDataSourcesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A previously created data source.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dataSource")]
        public virtual System.Collections.Generic.IList<DataSource> DataSource { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ListSessionsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If includeDeleted is set to true in the request, this list will contain sessions deleted with
        /// original end times that are within the startTime and endTime frame.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("deletedSession")]
        public virtual System.Collections.Generic.IList<Session> DeletedSession { get; set; } 

        /// <summary>Flag to indicate server has more data to transfer</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("hasMoreData")]
        public virtual System.Nullable<bool> HasMoreData { get; set; } 

        /// <summary>The continuation token, which is used to page through large result sets. Provide this value in a
        /// subsequent request to return the next page of results.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>Sessions with an end time that is between startTime and endTime of the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("session")]
        public virtual System.Collections.Generic.IList<Session> Session { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Holder object for the value of an entry in a map field of a data point.
    ///
    /// A map value supports a subset of the formats that the regular Value supports.</summary>
    public class MapValue : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Floating point value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("fpVal")]
        public virtual System.Nullable<double> FpVal { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Sessions contain metadata, such as a user-friendly name and time interval information.</summary>
    public class Session : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Session active time. While start_time_millis and end_time_millis define the full session time, the
        /// active time can be shorter and specified by active_time_millis. If the inactive time during the session is
        /// known, it should also be inserted via a com.google.activity.segment data point with a STILL activity
        /// value</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("activeTimeMillis")]
        public virtual System.Nullable<long> ActiveTimeMillis { get; set; } 

        /// <summary>The type of activity this session represents.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("activityType")]
        public virtual System.Nullable<int> ActivityType { get; set; } 

        /// <summary>The application that created the session.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("application")]
        public virtual Application Application { get; set; } 

        /// <summary>A description for this session.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>An end time, in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTimeMillis")]
        public virtual System.Nullable<long> EndTimeMillis { get; set; } 

        /// <summary>A client-generated identifier that is unique across all sessions owned by this particular
        /// user.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>A timestamp that indicates when the session was last modified.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("modifiedTimeMillis")]
        public virtual System.Nullable<long> ModifiedTimeMillis { get; set; } 

        /// <summary>A human readable name of the session.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>A start time, in milliseconds since epoch, inclusive.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTimeMillis")]
        public virtual System.Nullable<long> StartTimeMillis { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Holder object for the value of a single field in a data point.
    ///
    /// A field value has a particular format and is only ever set to one of an integer or a floating point value.
    /// LINT.IfChange</summary>
    public class Value : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Floating point value. When this is set, other values must not be set.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("fpVal")]
        public virtual System.Nullable<double> FpVal { get; set; } 

        /// <summary>Integer value. When this is set, other values must not be set.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("intVal")]
        public virtual System.Nullable<int> IntVal { get; set; } 

        /// <summary>Map value. The valid key space and units for the corresponding value of each entry should be
        /// documented as part of the data type definition. Keys should be kept small whenever possible. Data streams
        /// with large keys and high data frequency may be down sampled.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("mapVal")]
        public virtual System.Collections.Generic.IList<ValueMapValEntry> MapVal { get; set; } 

        /// <summary>String value. When this is set, other values must not be set. Strings should be kept small whenever
        /// possible. Data streams with large string values and high data frequency may be down sampled.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stringVal")]
        public virtual string StringVal { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ValueMapValEntry : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("key")]
        public virtual string Key { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual MapValue Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
